package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.CarDriverTypeMapper;
import com.ruoyi.system.domain.CarDriverType;
import com.ruoyi.system.service.ICarDriverTypeService;

/**
 * 司机类型Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-09-09
 */
@Service
public class CarDriverTypeServiceImpl implements ICarDriverTypeService 
{
    @Autowired
    private CarDriverTypeMapper carDriverTypeMapper;

    /**
     * 查询司机类型
     * 
     * @param id 司机类型主键
     * @return 司机类型
     */
    @Override
    public CarDriverType selectCarDriverTypeById(Long id)
    {
        return carDriverTypeMapper.selectCarDriverTypeById(id);
    }

    /**
     * 查询司机类型列表
     * 
     * @param carDriverType 司机类型
     * @return 司机类型
     */
    @Override
    public List<CarDriverType> selectCarDriverTypeList(CarDriverType carDriverType)
    {
        return carDriverTypeMapper.selectCarDriverTypeList(carDriverType);
    }

    /**
     * 新增司机类型
     * 
     * @param carDriverType 司机类型
     * @return 结果
     */
    @Override
    public int insertCarDriverType(CarDriverType carDriverType)
    {
        carDriverType.setCreateTime(DateUtils.getNowDate());
        return carDriverTypeMapper.insertCarDriverType(carDriverType);
    }

    /**
     * 修改司机类型
     * 
     * @param carDriverType 司机类型
     * @return 结果
     */
    @Override
    public int updateCarDriverType(CarDriverType carDriverType)
    {
        carDriverType.setUpdateTime(DateUtils.getNowDate());
        return carDriverTypeMapper.updateCarDriverType(carDriverType);
    }

    /**
     * 批量删除司机类型
     * 
     * @param ids 需要删除的司机类型主键
     * @return 结果
     */
    @Override
    public int deleteCarDriverTypeByIds(Long[] ids)
    {
        return carDriverTypeMapper.deleteCarDriverTypeByIds(ids);
    }

    /**
     * 删除司机类型信息
     * 
     * @param id 司机类型主键
     * @return 结果
     */
    @Override
    public int deleteCarDriverTypeById(Long id)
    {
        return carDriverTypeMapper.deleteCarDriverTypeById(id);
    }
}
